home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
jungle_adventure.swf
/
scripts
/
__Packages
/
Spikes.as
< prev
next >
Wrap
Text File
|
2006-11-29
|
1KB
|
38 lines
class Spikes extends SSObject
{
var assetID = "spikes";
var soundID = "spikes";
var value = -0.2;
var classID = SSGlobal.CLSID_OBJECT;
var collisionMask = SSGlobal.CLSID_SHAPE;
var strength = 250;
var editor_isItem = true;
var editor_name = "Spikes";
var editor_canRotate = true;
var editor_args_names = ["value"];
var editor_args_values = [0];
var editor_args_types = ["number"];
var editor_args_options = [[-1,1,0.01]];
var editor_args_descriptions = [""];
var editor_args_mode = [0];
var editor_args_component = ["NumericStepper"];
function Spikes(value)
{
super();
if(value != null)
{
this.value = value;
}
}
function onCollision(obj)
{
var _loc2_ = undefined;
(_loc2_ = new Vector(obj.x >= this.x ? 1 : -1,-2,0)).normalize();
obj.velocity.x = _loc2_.x * this.strength;
obj.velocity.y = _loc2_.y * this.strength;
GameSound.playSound(this.soundID);
obj.shiftHealth(this.value,this);
return GDK.Node.COLLISION_CANCEL;
}
}